package com.kgcx.opc.api;

import com.kgcx.common.bean.RequestData;
import com.kgcx.common.bean.ReturnData;
import com.kgcx.common.controller.BaseController;
import com.kgcx.common.rabbitmq.bean.Message;
import com.kgcx.opc.common.dto.DataResponse;
import com.kgcx.opc.service.AssignService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;

/**
 * @author 何凯
 * @version 0.1
 * @description
 * @time 2017/11/14 11:05
 * @since 0.1
 */
@Api(description = "图片上传", tags = "图片上传接口")
@RestController
@EnableAutoConfiguration
@RequestMapping("opc/v1/assign")
public class AssignController extends BaseController{

    @Autowired
    private AssignService assignService;


    @ApiOperation(value = "图片上传接口", httpMethod = "GET", notes = "根据指定图片名称上传ftp服务器接口接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "图片名称", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class)
    })
    @GetMapping("upload")
    public ReturnData uploadImag(@RequestParam String name) {
        RequestData requestData = this.getRequestData();
        assignService.uploadImag(name);
        return new ReturnData();
    }
}
